<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@page import="avicit.platform6.core.locale.PlatformLocalesJSTL"%>
<%@page import="java.util.Locale"%>
<%@page import="avicit.platform6.api.session.SessionHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<%@ taglib prefix="sec"
	uri="/WEB-INF/tags/shiro.tld"%>
<%@page import="avicit.platform6.api.sysshirolog.impl.AfterLoginSessionProcess"%>
<% 
Object lang=session.getAttribute(AfterLoginSessionProcess.SESSION_CURRENT_LANGUAGE_CODE);
String languageCode="zh_CN";
if(lang!=null){
	languageCode=lang.toString();
}
	Locale locale =SessionHelper.getLocaleByUser(request);
%>
	
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>著录定义</title>
<base href="<%=ViewUtil.getRequestPath(request)%>">
<link href="static/css/custom/lantop/css/custom.css" type="text/css"  rel="stylesheet">
<jsp:include
	page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
<script type="text/javascript"
	src="avicit/cbb/techclass/tabledefine/commtablemanager/table_node_record.js"></script>
<jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
<script type="text/javascript"
	src="avicit/cbb/techclass/tabledefine/commtablemanager/locale/language_<%=languageCode%>.js"></script>

<%
	String sysId = request.getParameter("sysId");
	String tableName = request.getParameter("tableName");
	String nodeTypeNew = request.getParameter("nodeType");
	String nodeId = request.getParameter("nodeId");
	String nodeName = request.getParameter("nodeName");
%>
<script type="text/javascript">
var baseurl = "<%=ViewUtil.getRequestPath(request)%>";
	//此事件必须放在jsp中,不能提取到js中,否则不能加载数据
	$(function() {
		sysId = "<%=sysId%>";
		tableName = "<%=tableName%>";
		nodeTypeNew = "<%=nodeTypeNew%>";
		nodeId = "<%=nodeId%>";
		nodeName = "<%=nodeName%>";
		if ("" == tableName || "null" == tableName) {
			tableName = "CBB_CS_WJ";
		}
		if ("" == nodeTypeNew || "null" == nodeTypeNew) {
			nodeTypeNew = "Y";
		}
		document.getElementById("selectCol").style.display = 'none';
		if (nodeTypeNew == "N") {
			$('#MoveUp').linkbutton('disable');
			$('#MoveDown').linkbutton('disable');
			$('#accept').linkbutton('disable');
		}
		if ("" == sysId || "null" == sysId) {
			sysId = "CBB";
		}
		if ("" == nodeId || "null" == nodeId) {
			nodeId = "-1";
		}
		if ("" == nodeName || "null" == nodeName) {
			nodeName = "测试";
		}
		$('#cbbTabColumnsDataGrid')
				.datagrid(
						{
							url : 'platform/aos/commtablemanagerController/getCbbTabColumnsDataForZL.json?sysId='
									+ sysId
									+ '&tableName='
									+ tableName
									+ '&isTemplet=' + isTemplet
						});
		ckeckGeneMethod();
	});
	// SanXiaFiles Create By Tangkun start
	function getResultByInput(){
		$('#cbbTabColumnsDataGrid').datagrid({
			url : 'platform/aos/commtablemanagerController/getCbbTabColumnsData.json?sysId=' + sysId + '&tableName=' + tableName + '&isTemplet=' + isTemplet
					+ '&colLabel=colLabel&inputWord=' + encodeURI(encodeURI($('#query').val()))
		});
	}
	
	function keyDownQuery(){
		if(event.keyCode==13){
			getResultByInput();
		}
	}
	// SanXiaFiles Create By Tangkun End
</script>
<style type="text/css">
.textbox {
	border: solid 1px #a5acb5;
}

.input,img {
	vertical-align: middle;
}

<!--
实现input和img水平对齐 -->.labelbg {
	background:
		url('../../js/jQuery/jquery-easyui-1.3.5/themes/icons/required.gif')
		right 0 no-repeat;
}
.icon-im-newndisallfield{
   margin-top:0px !important;
}
</style>
</head>
<body id="myBody" class="easyui-layout">
	<div data-options="region:'center'"
		style="height: 0; overflow: hidden; font-size: 0;" fit:true,>
		<div id="tb"  style="padding:10px 5px;" >
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_table_node_record_button_MoveUp">
				<%-- 上移 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-newup" style="margin-left:20px;"
					onclick="MoveUp();" href="javascript:void(0);" id="MoveUp"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.button.moveUp","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_table_node_record_button_MoveDown">
				<%-- 下移 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-newdown"
					onclick="MoveDown();" href="javascript:void(0);" id="MoveDown"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.button.moveDown","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_table_node_record_button_accept">
				<%-- 保存 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-save"
					onclick="accept();" href="javascript:void(0);" id="accept"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.button.save","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_table_node_record_button_selectAllCol">
				<%-- 显示全部字段 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-newndisallfield"
					onclick="selectAllCol();" href="javascript:void(0);"
					id="selectAllCol"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.button.showAllField","i18n.lantop",locale)%></a>
				<%-- 显示基本字段 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-newnhideallfield"
					onclick="selectAllCol();" href="javascript:void(0);" id="selectCol"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.button.showAllField.button.showBasicField","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_table_node_record_button_accept">
				<%-- 同步 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-ok"
					onclick="synchronization();" href="javascript:void(0);" id="accept"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.button.synchronization","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
		<!--   
			SanXiaFiles Create By Tangkun End 
			-->
			<div style="background: white; width: 150px; height: 25px; margin-right: 10px; border-radius: 3px; border: 1px solid #ccc; float: right;">
				<input placeholder="快速检索" type="text" id="query" onblur="getResultByInput()" onkeydown="keyDownQuery();"
					style="float: left; box-sizing: border-box; padding-left: 5px; width: 123px; height: 25px; outline: none; border: none;" />
				<img src="avicit/im/lantop/common/search/image/icon_tool14.png"
					style="float: right; margin-top: 2px; margin-right: 2px;cursor: pointer;">
			</div>
			<!-- 
			 SanXiaFiles Create By Tangkun End  
		-->
		</div>
		<table id="cbbTabColumnsDataGrid" data-options="
										rownumbers: false,
										animate: true,
										collapsible: false,
										fitColumns: true,
										autoRowHeight: false,
										singleSelect: true,
										pagination:true,
										scrollbarSize:0,
										pageSize:100, 
										pageList:[100,150,200], 
							    		striped:true,
										fit:true,
										method: 'post',
										onClickRow:onClickRow,
										selectOnCheck:false,
										checkOnSelect:false,
										striped:true,
										toolbar: '#tb',
										showRefresh:false
									">
			<thead  fit:true>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_id">
						<th data-options="field:'id', halign:'center',hidden:true"
							title="主键ID" width="20">主键ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colOrder">
						<%-- 顺序 --%>
						<th
							data-options="field:'colOrder', halign:'center', align:'center',formatter:fomaterColOrder,editor:{type:'text'}"
							width="50" title="顺序"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.order","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colLabel">
						<%-- 字段中文名 --%>
						<th
							data-options="field:'colLabel',halign:'center', align:'center',formatter:fomaterColLabel"
							width="80" title="字段中文名"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.fieldCHNName","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colName">
						<th
							data-options="field:'colName', halign:'center', align:'center',hidden:true"
							width="120" title="字段名"></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colType">
						<th
							data-options="field:'colType',halign:'center', align:'center',hidden:true"
							width="140" title="字段类型">字段类型</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colLength">
						<th
							data-options="field:'colLength',halign:'center', align:'center',hidden:true"
							width="80" title="长度">长度</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colDecimal">
						<th
							data-options="field:'colDecimal',halign:'center', align:'center',hidden:true"
							width="80" title="小数位数">小数位数</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colDropdownType">
						<th
							data-options="field:'colDropdownType',halign:'center', align:'center',hidden:true"
							width="100" title="类型">类型</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colRuleName">
						<th
							data-options="field:'colRuleName',halign:'center', align:'center',hidden:true"
							width="100" title="生成规则英文">生成规则英文</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colIsVisible">
						<%-- 是否显示（添加/编辑） --%>
						<th
							data-options="field:'colIsVisible', halign:'center', align:'center',editor:{type:'text'},formatter:fomaterIsVisible"
							width="120" title="是否显示（添加/编辑）"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.isShow(add/edit)","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colIsEdit">
						<%-- 是否编辑（添加/编辑） --%>
						<th
							data-options="field:'colIsEdit', halign:'center', align:'center',editor:{type:'text'},formatter:fomaterIsEdit"
							width="120" title="是否编辑（添加/编辑）"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.isEdit(add/edit)","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colIsComplement">
						<%-- 是否补足 --%>
						<th
							data-options="field:'colIsComplement', halign:'center', align:'center',editor:{type:'text'},formatter:fomaterIsComplement"
							width="80" title="是否补足"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.isComplement","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colComplementNum">
						<%-- 补足位数 --%>
						<th
							data-options="field:'colComplementNum', halign:'center', align:'center',editor:{type:'numberbox',options:{'validType':'length[0,2]'}},formatter:fomaterComplementNum"
							width="80" title="补足位数"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.complementPlaces","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colGeneMethod">
						<%-- 生成方式 --%>
						<th
							data-options="field:'colGeneMethod',  halign:'center', align:'center', editor:{type:'combobox',options:{required:true,panelHeight: 'auto',valueField:'lookupCode',textField:'lookupName',data:[{lookupCode:0,lookupName:'空'},{lookupCode:1,lookupName:'默认值'},{lookupCode:2,lookupName:'序列'},{lookupCode:3,lookupName:'顺带'},{lookupCode:4,lookupName:'组合项'},{lookupCode:5,lookupName:'统计生成'}],editable:false,onSelect:onSelectGneMethod,onHidePanel: typeOnHidePanel,onChange : typeOnChange}},formatter:fomaterColGeneMethod"
							width="80" title="生成方式"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.createWay","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_tabxle_node_record_datagrid_colGeneMethodRule">
						<th
							data-options="field:'colGeneMethodRule', halign:'center', align:'center', hidden:true,editor:{type:'text'}"
							width="100" title="生成方式规则">生成方式规则</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_tabxle_node_record_datagrid_colValueName">
						<%-- 生成方式规则显示 --%>
						<th
							data-options="field:'colValueName', halign:'center', align:'center',editor:{type:'text'},formatter:fomatercolValueName"
							width="100" title="生成方式规则显示"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.recordDefine.table.createWayRuleShow","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_structure_datagrid_colIsDisplay">
						<th data-options="field:'colIsDisplay',hidden: true" width="100"
							title="是否可见">是否可见</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_structure_datagrid_colIsSys">
						<th data-options="field:'colIsSys',hidden: true" width="100"
							title="系统字段">系统字段</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_node_record_datagrid_colShowFormat">
						<th
							data-options="field:'colShowFormat', hidden: true, halign:'center', align:'center', editor:{type:'combobox',options:{required:true,panelHeight: 'auto',valueField:'lookupCode',textField:'lookupName',data:[{lookupCode:0,lookupName:'无'},{lookupCode:1,lookupName:'日期'},{lookupCode:2,lookupName:'金额'}],editable:false}},formatter:fomaterColShowFormat"
							width="100" title="显示格式">显示格式</th>
					</sec:accesscontrollist>
				</tr>
			</thead>
		</table>
	</div>
</body>
<script type="text/javascript" src="static/js/platform/index/js/divscroll.js" ></script>
<script>
	$(function(){
		$(".datagrid-view2").find(".datagrid-body").perfectScrollbar();
	});
</script>
</html>
